<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./template/StakeholderTemplate.xhtml">
    <ui:define name="begin">
        <f:view beforePhase="#{reservationManagerBean.initViewPendingConfirmation}"/>
    </ui:define>
    <ui:define name="contentInsert">
        <h:body>
            <h:form id="formMain">  
                <p:dataTable var="pending" value="#{reservationManagerBean.pendingConfirmations}"   
                             selection="#{reservationManagerBean.selectedReservations_confirm}" >  
                    <f:facet name="header">  
                        List of Pending Confirmation Reservation
                    </f:facet>                 

                    <p:column selectionMode="multiple" />

                    <p:column>  
                        <f:facet name="header">  
                            <h:outputText value="Customer Name" />  
                        </f:facet>  
                        <h:outputText value="#{pending.customer.name}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            <h:outputText value="Reservation ID" />  
                        </f:facet>  
                        <h:outputText value="#{pending.id}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            <h:outputText value="Time start" />  
                        </f:facet>  
                        <h:outputText value="#{pending.timeBegin}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            <h:outputText value="Time end" />  
                        </f:facet>  
                        <h:outputText value="#{pending.timeEnd}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            <h:outputText value="Confirmation" />  
                        </f:facet>  
                        <h:outputText value="#{pending.confirmation}" />  
                    </p:column>                      
                </p:dataTable>

                <p:commandButton id="btn1" value="Confirm"  actionListener="#{reservationManagerBean.toConfirmed}"/>

                <p:commandButton id="btn2" value="Reject"  actionListener="#{reservationManagerBean.toRejected}"/>

            </h:form>  
        </h:body>
    </ui:define>
</ui:composition>